package com.hnhs.threadlocalutil;

import com.hnhs.info.PageInfo;

public class LocalPageInfoUtil {
    //创建线程对象 共享数据
    private static ThreadLocal<PageInfo> pageInfoThreadLocal=new ThreadLocal<>();

    //线程上设置一个标签
    public static void set(PageInfo pageInfo){
        pageInfoThreadLocal.set(pageInfo);
    }
    //获取线程数据
    public static PageInfo get(){
        return pageInfoThreadLocal.get();
    }
    public static void remove(){
        pageInfoThreadLocal.remove();
    }
}
